@import "variables";

$sidebar-menu-active-bg: #1C1A46;
$sidebar-menu-item-bg: #293863;

#app {
  .app-wrapper.openSidebar {
    .svg-icon {
      margin-right: 13px;
    }
    .scrollbar-wrapper {
      background: url("../images/sidebar-bottm-bg@2x.png") no-repeat center bottom;
      background-size: contain;
    }
  }

  .main-container {
    min-height: 100%;
    transition: margin-left .28s;
    margin-left: $sideBarWidth;
    position: relative;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
    background-color: #242254;
    height: 100%;
    position: fixed;
    font-size: 0;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    box-shadow: 0 0 10px 6px $box-shadow-color;
    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .el-menu {
      background-color: $sidebar-menu-item-bg;
      //background-color: $sidebar-menu-active-bg;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0;
    }

    .el-scrollbar {
      height: 100%;
    }

    .navBarList{
      background-color: $sidebar-menu-item-bg;
    }

    &.has-logo {
      .el-scrollbar {
        height: calc(100% - 50px);
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      width: 17px;
      height: 17px;
      fill: #fff;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    // 菜单左侧padding
    .el-menu-item {
      //font-size: 12px;
      padding-left: 60px!important;
    }

    // 一级目录padding不变
    .el-menu-item.submenu-title-noDropdown {
      padding-left: 20px!important;
    }

    .el-menu-item, .el-submenu__title {
      height: 40px;
      margin: 2px 0;
      line-height: 40px;
    }

    // menu hover
    .submenu-title-noDropdown, .el-submenu__title {
      &:hover {
        background-color: $sidebar-menu-active-bg;
      }
    }

    .is-active>.el-submenu__title {
      color: #fff !important;
    }

    .nest-menu .el-submenu>.el-submenu__title, .el-submenu .el-menu-item {
      background-color: $sidebar-menu-item-bg;
      position: relative;
      .item-bg{
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
      }
      //&:hover {
      //  background-color: #2F9BFF;
      //  color: #fff;
      //  .item-bg{
      //    background: #2F9BFF;
      //    opacity: 0.3;
      //  }
      //}
      &:hover {
        background-color: $sidebar-menu-active-bg;
        color: #fff;
        .item-bg{
          background: $sidebar-menu-active-bg;
          opacity: 0.3;
        }
      }
    }
    .el-submenu .el-menu-item.is-active {
      position: relative;
      &:before {
        content: " ";
        //width: 4px;
        //height: 100%;
        //background:rgba(77,169,255,1);
        position: absolute;
        left: 0;
        top: 0;
        width:4px;
        height:100%;
        background:rgba(254,223,71,1);
        box-shadow:2px 0 6px 0 rgba(255,197,61,0.2);
        border-radius:0 100px 100px 0;
        z-index: 1;
      }
      .item-bg{
        background: $sidebar-menu-active-bg;
        opacity: 0.3;
      }
      //.item-bg{
      //  background-color: #2F9BFF;
      //  opacity: 0.3;
      //}
    }
    .el-menu-item:focus, .el-menu-item:hover{
      outline: 0;
      background-color: $sidebar-menu-active-bg;
    }
  }

  .el-menu-item:focus, .el-menu-item:hover{
    outline: 0;
    background-color: $sidebar-menu-active-bg;
  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {
      margin-left: 54px;
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          //margin-left: 20px;
        }
      }
    }

    .el-submenu {
      overflow: hidden;

      &>.el-submenu__title {
        padding: 0 !important;

        .svg-icon {
          //margin-left: 20px;
        }

        .el-submenu__icon-arrow {
          display: none;
        }
      }
    }

    .el-menu-item, .el-submenu__title {
      text-align: center;
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          &>span:not(.iconfont) {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0px;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $sideBarWidth !important;
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {
    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// menu right-arrow
.el-submenu .el-submenu__icon-arrow {
  font-size: 14px;
}

.el-submenu:hover, .el-submenu.is-opened {
  .el-submenu__icon-arrow.el-icon-arrow-down {
    color: #fff;
  }
}

// when menu collapsed
.el-menu--vertical {

  .el-menu {
    background-color: $sidebar-menu-item-bg;
  }

  .el-menu-item:focus, .el-menu-item:hover{
    outline: 0;
    background-color: $sidebar-menu-item-bg;
  }

  &>.el-menu {
    .svg-icon {
      margin-right: 16px;
    }
  }

  .el-menu-item, .el-submenu__title {
    height: 40px;
    line-height: 40px;
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
    &:hover {
      outline: 0;
      background-color: $sidebar-menu-active-bg;
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
